/*
//
//              INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license  agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in  accordance  with the terms of that agreement.
//    Copyright (c) 2007 Intel Corporation. All Rights Reserved.
//
//
*/

#ifndef __UMC_AVS_SLICE_HEADER_H
#define __UMC_AVS_SLICE_HEADER_H

#include "ippdefs.h"
#include "umc_avs_consts.h"

namespace UMC
{

struct AVS_SLICE_HEADER
{
    // number of the first macroblock in the slice. Every frame/field starts
    // with first_mb equal to zero.
    Ipp32u first_mb;

    // 8-bit unsigned integer with range 0x00 to 0xAF. It gives the vertical
    // position of the first macroblock in the slice in macroblock units.
    // If vertical_size of a coded frame is greater than 2800, then the
    // vertical position depends on slice_vertical_position and
    // slice_vertical_position_extension.
    Ipp32u slice_vertical_position;

    // 3-bit unsigned integer. If vertical_size of a coded frame is less than
    // 2800, slice_vertical_position_extension shall not be presentin bitstream.
    Ipp32u slice_vertical_position_extension;

    // It is set to '1' to indicate that the quantization parameter in
    // the slice does not change, while '0' means that the quantization
    // parameter may change.
    Ipp32u fixed_slice_qp;

    // 6-bit unsigned integer. It specifies the quantization parameter of
    // a slice, with a range from 0 to 63 inclusive.
    Ipp32u slice_qp;

    // '1' indicates that weighted prediction shall be applied to inter
    // prediction process of a macroblock. '0' indicates that weighted
    // prediction shall not be applied to inter prediction process of
    // a macroblock.
    Ipp32u slice_weighting_flag;

    // 8-bit unsigned integer. It specifies the scaling parameter for
    // luma weighted prediction.
    Ipp32u luma_scale[AVS_DIRECTIONS][4];

    // 8-bit signed integer. It specifies the offset parameter for
    // luma weighted prediction.
    Ipp32s luma_shift[AVS_DIRECTIONS][4];

    // 8-bit unsigned integer. It specifies the scaling parameter for
    // chroma weighted prediction.
    Ipp32u chroma_scale[AVS_DIRECTIONS][4];

    // 8 bits signed integer. It specifies the offset parameter for
    // chroma weighted prediction.
    Ipp32s chroma_shift[AVS_DIRECTIONS][4];

    // '0' indicates that all inter coded macroblocks shall use weighted
    // prediction. '1' indicates that weighted prediction for inter coded
    // macroblock shall depend on mb_weighting_flag flag of that macroblock.
    Ipp32u mb_weighting_flag;

    // '1' means that the current slice belongs to the second (lower) field of
    // the frame. '0' means that the current slice belongs to the first (upper)
    // field of the frame.
    Ipp32u isSecondField;
};

} // namespace UMC

#endif // __UMC_AVS_SLICE_HEADER_H
